<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<html:html>
  <logic:present parameter="id_grupo">
    <bean:define id="tipo" value="Editar Grupo"/>
  </logic:present>
  <logic:notPresent parameter="id_grupo">

    <bean:define id="tipo" value="Insertar Grupo"/>
  </logic:notPresent>
<head>
<title>
.:: EPrice ::. <bean:write name="tipo"/>
</title>
<link href="css/estilos.css" rel="stylesheet" type="text/css">
</head>
<script type="" language="Javascript">
function limpiar(){
  document.getElementById("str_descGrupo").value = '';
  document.getElementById("str_lineaGrupo").value = '';
}


function valida(){
    if(document.getElementById("str_descGrupo").value.length==0){
      alert('Introduzca la descripcion de grupo');
      return false;
    }

    else
       return true;
}
</script>
<body bgcolor="#ffffff" onload="window.focus();">
  <html:form action="grupoAction">
    <logic:present parameter="id_grupo">
       <html:hidden property="action" value="actualizarGrupo"/>
    </logic:present>
    <logic:notPresent parameter="id_grupo">
      <html:hidden property="action" value="insertarGrupo"/>
    </logic:notPresent>
   <table border="0" cellpadding="1" cellspacing="0">
     <tr>
       <td height="25" align="right" valign="middle" class="encabezadoTabla font_general">
         <img src="images/img_loginFlecha.gif" alt=" " width="17" height="23">&nbsp;
       </td>
       <td height="25" align="left" valign="middle" class="encabezadoTabla font_general">
         &nbsp;<bean:write name="tipo"/>
        </td>
      </tr>
      <tr>
        <td class="colorLabel font_general">Descripcion Grupo:&nbsp;</td>
        <td class="colorCampo font_general"><html:hidden property="str_idGrupo"/>
          <html:text property="str_descGrupo" styleClass="textfield" />
        </td>
      </tr>
      <tr>
        <td align="right" class="colorLabel font_general">Linea Grupo:&nbsp;</td>
        <td align="right" class="colorCampo font_general">
          <html:select property="str_lineaGrupo" styleClass="textfield">
            <html:option value="">Sin Linea</html:option>
            <html:options collection="arr_linea" property="str_idLinea" labelProperty="str_descLinea"/>
          </html:select>
        </td>
      </tr>
      <tr>
        <td align="center" class="colorLabel font_general"><html:button styleClass="boton" onclick="limpiar();" property="Limpiar" value="Limpiar"></html:button></td>
        <td align="center" class="colorLabel font_general" onclick="return valida();"><html:submit styleClass="boton">Guardar</html:submit></td>
      </tr>
    </table>
  </html:form>
   <logic:present name="bn_grupo">ok</logic:present>
</body>
</html:html>
